package measures;

/**
 * @author Thomas Wangler, wangler_thomas@hotmail.com
 * Translation Memories for patent translation
 * Fuzzy_Match_Score
 * Class that computes the Fuzzy Match score based on edit distance 
 * @param DistanceSet edis (see DistanceSet for further information)
 * @return double FuzzyMatchScore for a given input set of type DistanceSet
 */
public class Fuzzy_Match_Score{

	
	public static double computeFMS(DistanceSet edis){
		
		double fms;
		double divisor =(double)Math.max(edis.getSourceList().size(), edis.getTMSourceList().size());
		
		fms = 1 - ( (double)edis.getEditDistancePhrase() / divisor );
		
		return fms;
		
	}
}
